package com.tojabo.sortObject;

import java.util.Comparator;
import java.util.List;

public class SortUtil {

	public static void main(String[] args) {

	}

	public static <T> void sort(List<T> a, Comparator<? super T> c) {
		int index = 0;
		
		T temp ;

		for (int i = 0; i < a.size(); i++) {
			index = i;
			temp = a.get(i);
			for (int j = i; j < a.size(); j++) {
				if (c.compare(a.get(j),temp)>0) {
					index = j;
					temp = a.get(j);
				}
			}
			a.set(index, a.get(i));
			a.set(i, temp);
		}
	}


}
